#define _CRT_SECURE_NO_WARNINGS 1


#define _CRT_SECURE_NO_WARNINGS 1

#include <iostream>
#include <unordered_map>
#include <string>
#include <vector>
using namespace std;


int main()
{
	vector<vector<int>> it;
	it[0] = { 1, 1, 1 };
	it[1] = { 2, 3, 2 };
	it[2] = { 1, 5, 2 };

	for (int i = 0; i < it.size(); i++)
	{
		int a = it[i][0], b = it[i][1], c = it[i][2];
		int x = min(a, min(b, c));
		int y = b - x - 1;
		cout << 2 * x + y << endl;
	}


	return 0;
}
